<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增ERP付款信息" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-pay-add" class="form-horizontal">
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "流水号"/>：
    </label>
        <div class="col-sm-8"><input name="serialNumber" value="${bpmErpPersonPay.serialNumber}" class="form-control"
                                     type="text" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "申请人"/>：
    </label>
        <div class="col-sm-8"><input name="applyUsername" value="${bpmErpPersonPay.applyUsername?default('')}"
                                     class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "受益人"/>：
    </label>
        <div class="col-sm-8"><input name="beneficiaryUsername" value="${bpmErpPersonPay.beneficiaryUsername?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "选择账户"/>：</label>
        <div class="col-sm-8">

            <select name="selectAccount" class="form-control m-b" readonly="true" disabled>
                <#list dict.getType('sys_erp_select_account')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}" <#if d.dictValue==(bpmErpPersonPay.selectAccount+'')?default("") >selected = "selected"</#if>>${d.dictLabel}</option>
                        </#if>
                    </#items>
                </#list>
            </select>

        </div>
    </div>
<div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "账户余额"/>：
</label>
    <div class="col-sm-8"><input name="accountBalance" value="${bpmErpPersonPay.accountBalance?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
</label>
    <div class="col-sm-8"><input name="payMoney" value="${bpmErpPersonPay.payMoney?default('')}" class="form-control"
                                 type="text" readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="payMemo" class="form-control" readonly="true">${bpmErpPersonPay.payMemo?default('')}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "确认打款"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="payConfirmpay" dictType="sys_crm_isOrNo" value="${bpmErpPersonPay.payConfirmpay?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group confirmClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "打款日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="payPaymentdate" data-type="date"
                   value="${(bpmErpPersonPay.payPaymentdate?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd"
                   type="text" readonly="true"/>
        </div>
    </div>
</div>
<div class="form-group confirmClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "偏好付款方式"/>：</label>
    <div class="col-sm-8">
        <@form.select name="payPreferencePaymethod" dictType="sys_erp_first_paymethod" value="${bpmErpPersonPay.payConfirmpay?default('')}" blankValue="" blankLabel="请选择" readOnly="true" />
</div>
</div>
<div class="form-group confirmClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "付款方式备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="payMethodMemo" class="form-control"
                  readonly="true">${bpmErpPersonPay.payMethodMemo?default('')}</textarea>
    </div>
</div>

<div class="form-group confirmClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "附件"/>：</label>
    <div class="col-sm-8">
        <div class="layui-upload">
            <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>大小</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="demojiazhaoList">
                    <tr id="upjiazhaoload"></tr>
                    <#list proof as item>

                    <tr id="upload${item_index}">
                        <td> ${item.fileName?default("")}</td>
                        <td> ${item.fileSize?default("")}</td>
                        <td>已上传</td>
                        <td>
                            <a class="btn btn-danger btn-sm" href="#" download="${item.url}"><i class="fa fa-download"></i></a>
                        </td>
                    </tr>
                    </#list>
                    </tbody>
                </table>
            </div>

        </div>
    </div>
</div>
<div class="form-group confirmClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "证明"/>：
</label>
    <div class="col-sm-8"><input name="payProof" value="${bpmErpPersonPay.payProof?default('')}" class="form-control"
                                 type="text" readonly="true">
    </div>
</div>
<div class="form-group checkClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "接收人名称"/>：
</label>
    <div class="col-sm-8"><input name="payRecipientName" value="${bpmErpPersonPay.payRecipientName?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group checkClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "接收人地址"/>：
</label>
    <div class="col-sm-8"><input name="payRecipientAddress" value="${bpmErpPersonPay.payRecipientAddress?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group checkClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "接收人手机"/>：
</label>
    <div class="col-sm-8"><input name="payRecipientPhone" value="${bpmErpPersonPay.payRecipientPhone?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group wireClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
</label>
    <div class="col-sm-8"><input name="payAccountNumber" value="${bpmErpPersonPay.payAccountNumber?default('')}"
                                 class="form-control" type="number" readonly="true">
    </div>
</div>
<div class="form-group wireClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "汇款路径号码"/>：
</label>
    <div class="col-sm-8"><input name="payRoutingNumber" value="${bpmErpPersonPay.payRoutingNumber?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group wireClass"><label class="col-sm-3 control-label"><@ctx.i18n text = "开户行"/>：
</label>
    <div class="col-sm-8"><input name="payBankAddress" value="${bpmErpPersonPay.payBankAddress?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group rmbClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "人民币汇款"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="payRmbRemittanceMethod" dictType="sys_crm_isOrNo" value="${bpmErpPersonPay.payRmbRemittanceMethod?default('')}" readOnly="true"/>
    </div>
</div>
<div class="form-group rmbClassMoney"><label class="col-sm-3 control-label"><@ctx.i18n text = "银行名称"/>：
</label>
    <div class="col-sm-8"><input name="payBankName" value="${bpmErpPersonPay.payBankName?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group rmbClassMoney"><label class="col-sm-3 control-label"><@ctx.i18n text = "银行账号"/>：
</label>
    <div class="col-sm-8"><input name="payBankAccount" value="${bpmErpPersonPay.payBankAccount?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group rmbClassMoney"><label class="col-sm-3 control-label"><@ctx.i18n text = "账户备注"/>：
</label>
    <div class="col-sm-8"><input name="payAccountName" value="${bpmErpPersonPay.payAccountName?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "付款结果"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="cashierPaymentResult" dictType="sys_crm_isOrNo"
        value="${bpmErpPersonPay.cashierPaymentResult?default('')}" readOnly="true"/>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="cashierDate" data-type="date"
                   value="${(bpmErpPersonPay.cashierDate?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text"
                   readonly="true"/>
        </div>
    </div>
</div>
<div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "接收人编号"/>：
</label>
    <div class="col-sm-8"><input name="cashierReceiptNumber" value="${bpmErpPersonPay.cashierReceiptNumber?default('')}"
                                 class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "证明"/>：
</label>
    <div class="col-sm-8">
        <input name="cashierProof" value="${bpmErpPersonPay.cashierProof?default('')}" class="form-control" type="text"
               readonly="true">
    </div>
</div>
<div class="form-group"><label class="col-sm-3 control-label"><@ctx.i18n text = "出纳备注"/>：
</label>
    <div class="col-sm-8">
        <textarea name="cashierMemo" class="form-control"
                  readonly="true">${bpmErpPersonPay.cashierMemo?default('')}</textarea>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳提交时间"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="cashierSubmitTime" data-type="date"
                   value="${(bpmErpPersonPay.cashierSubmitTime?string('yyyy-MM-dd HH:mm:ss'))!}" data-format="yyyy-MM-dd"
                   type="text" readonly="true"/>
        </div>
    </div>
</div>
<input id="processStatus" type="hidden" value="${bpmErpPersonPay.processStatus?default('')}">
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    $(function () {
        var processStatusValue = $("#processStatus").val();
        if (processStatusValue == "1") {
            var payConfirmpayValue = $("[name='payConfirmpay']")[0].checked;
            if(payConfirmpayValue){
                $(".confirmClass").show();
            }
            else{
                $(".confirmClass").hide();
            }
            var payPreferencePaymethodValue=$("[name='payPreferencePaymethod']").val();
            console.log("下拉框的值为",payPreferencePaymethodValue)
            if(payPreferencePaymethodValue=="1"){
                $(".checkClass").show();
                $(".wireClass").show();
                $(".rmbClass").hide();
                $(".rmbClassMoney").hide();
            }
            else if(payPreferencePaymethodValue=="2"){
                $(".checkClass").hide();
                $(".wireClass").show();
                $(".rmbClass").hide();
                $(".rmbClassMoney").hide();
            }
            else if(payPreferencePaymethodValue=="3"){
                $(".checkClass").hide();
                $(".wireClass").hide();
                $(".rmbClass").show();
                if($("[name='payRmbRemittanceMethod']")[0].checked){
                    $(".rmbClassMoney").show();
                }
                else{
                    $(".rmbClassMoney").hide();
                }
            }
            else{
                console.log("选择了现金或者是空值")
                $(".checkClass").hide();
                $(".wireClass").hide();
                $(".rmbClass").hide();
                $(".rmbClassMoney").hide();
            }
        }
    })
    var prefix = baseURL + "erp/pay"
    $("#form-pay-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/add", $('#form-pay-add').serialize());
        }
    }
</script>
</@footer>
</@pageTheme>